function createApp(rootComponent) {
  return {
    mount(selector) {
      // 将所有dom挂载到select下
      const container = document.querySelector(selector)
      // 是否已经挂载
      let isMounted = false
      // 保存oldVNode
      let oldVNode = null
      watchFn(function() {
        if(isMounted) {  //已经挂载
          const newVNode = rootComponent.render()
          patch(oldVNode,newVNode)
          oldVNode = newVNode
        }else{  //没有挂载
          oldVNode = rootComponent.render()
          mount(oldVNode,container)
          isMounted = true
        }
      })
    }
  }
}